/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pkg4funparse;

import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author l
 */
public class Data {
    public static ArrayList<Integer> RULES[];
    public static ArrayList<Symbol> SYMBOLS;
    public static int[][] M;
    public static int N_TERM_SIZE;
    public static int TERM_SIZE;
    public static HashMap<String,Integer> tkInd;
    public static HashMap<String,Symbol> tkSymb;

    public static void setRules(ArrayList[] rules) {
        Data.RULES = rules;
    }

    public static void setM(int[][] M) {
        Data.M = M;
    }

    public static void setN_TERM_SIZE(int TERM_SIZE) {
        Data.N_TERM_SIZE = TERM_SIZE;
    }

    public static void setSymbols(ArrayList<Symbol> symbols) {
        Data.SYMBOLS = symbols;
    }

    public static void setTermSize(int rulesSize) {
        Data.TERM_SIZE = rulesSize;
    }

    public static int code(int j) {
        return j + N_TERM_SIZE;
    }

    public static int decode(int j) {
        return j - N_TERM_SIZE;
    }

    public static void setTki(HashMap tokenIndex) {
        Data.tkInd = tokenIndex;
    }

    public static void setTks(HashMap<String,Symbol> tokenSymbol) {
        Data.tkSymb = tokenSymbol;
    }
}
